#include <cstdio>
#include <bitset>
#include <cstring>
#include <cassert>
#include <algorithm>
using namespace std;
const int N=1000003;
const int L=30,M=14;
char s[N];
char w[L][L];
bitset<L*L> ava[N],R,G,B,X,Y;
int main(){
	freopen("snake.in","r",stdin);
	freopen("snake.out","w",stdout);
	scanf("%s",s);
	char o[3]={'R','G','B'};
	for(int i=0;i<15;++i){
		for(int j=0;j<10;++j){
			w[i*2+0][j*3+0]=o[0];
			w[i*2+1][j*3+0]=o[0];
			w[i*2+0][j*3+1]=o[1];
			w[i*2+0][j*3+2]=o[1];
			w[i*2+1][j*3+1]=o[2];
			w[i*2+1][j*3+2]=o[2];
			swap(o[1],o[2]);
		}
		rotate(o,o+1,o+3);
	}
	printf("%d %d\n",L,L);
	for(int i=0;i<L;++i){
		for(int j=0;j<L;++j){
			if(w[i][j]=='R') R.set(i*L+j);
			if(w[i][j]=='G') G.set(i*L+j);	
			if(w[i][j]=='B') B.set(i*L+j);
			if(j) X.set(i*L+j);
			if(j+1<L) Y.set(i*L+j);
			putchar(w[i][j]);
		}
		putchar('\n');
	}
	int len=strlen(s);
	ava[len].set();
	for(int i=len-1;~i;--i){
		ava[i]=(ava[i+1]>>L)|(ava[i+1]<<L)|((ava[i+1]&X)>>1)|((ava[i+1]&Y)<<1);
		if(s[i]=='R') ava[i]&=R;
		if(s[i]=='G') ava[i]&=G;
		if(s[i]=='B') ava[i]&=B;
	}
	int pos=ava[0]._Find_first();
	int x=pos/L,y=pos%L;
	printf("%d %d\n",x+1,y+1);
	for(int i=1;i<len;++i){
		assert(w[x][y]==s[i-1]);
		if(y&&ava[i][pos-1]){putchar('L');--y;--pos;continue;}
		if(y+1<L&&ava[i][pos+1]){putchar('R');++y;++pos;continue;}
		if(x&&ava[i][pos-L]){putchar('U');--x;pos-=L;continue;}
		if(x+1<L&&ava[i][pos+L]){putchar('D');++x;pos+=L;continue;}
	}
	putchar('\n');
	assert(w[x][y]==s[len-1]);
	return 0;
}
